package com.base.cn.platform.os.service.course.qa.record;

import com.base.cn.platform.os.entity.manage.teacher.TeacherExpand;
import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author LIZHIPENG
 * @since 2018/5/2
 */
@FeignClient(name= CourseBaseService.appName, configuration = FeignAuthConfig.class)
public interface QaTeacherCommissionService extends CourseBaseService {

    /**
     * 查询数量
     * @param commission 条件对象
     * @return 数量
     */
    @RequestMapping(contextPath + "/getCommissionCount")
    BigDecimal getCommissionCount(@RequestBody Map<String, Object> commission);

    /**
     * 查询问答专家分成记录表（分页）
     * @param currentPage 页码
     * @param params 条件
     * @param questionData 是否设置问题数据：true：是，false：否
     * @param userData 是否设置用户数据：true：是，false：否
     * @param teacherData 是否设置收益专家数据：true：是，false：否
     * @return
     */
    @RequestMapping(contextPath + "/queryQaTeacherCommissionListPage")
    Map<String, Object> queryQaTeacherCommissionListPage(@RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                                         @RequestBody Map<String, Object> params,
                                                         @RequestParam("questionData") boolean questionData,
                                                         @RequestParam("userData") boolean userData,
                                                         @RequestParam("teacherData") boolean teacherData);

    /**
     * 查询问答讲师收益
     * @return
     */
    @RequestMapping(contextPath +"/qaTeacherCommissionSum")
     List<TeacherExpand> qaTeacherCommissionSum(@RequestParam("teacherId")BigDecimal teacherId);
}
